<include file="Public/header"/>

<div class="two-main">
	<div class="wrapperBox">
		<div class=" pos">
			<ul class="two" id="wate">
				<volist name="list" id="vo">
				<li class="item animate_afc   animate_start" >
					<h1>{$vo['article_title']}</h1>
					<p>{$vo['article_content']}</p>
					<a href="{:U('Index/question',array('id'=>$vo['article_id']))}" class="enter pd">参与辩论</a>
				</li>
				</volist>
			</ul>
           <div class="clear"></div>
		</div>
		<div class="pro_page">  
			{$page}
		</div>
<div class="footer">
	<div class="wrapperBox">
      <p> Copyright © 2004-2015 icp号:123456789  </p>    
    </div>   
</div>


	</div>
</div>



<script>

var margin = 10; 
var li=$("#wate li"); 
var li_W = li[0].offsetWidth+margin; 
function liuxiaofan(){ 
    var h=[]; 
    var n = 4; 
    for(var i = 0;i < li.length;i++) { 
        li_H = li[i].offsetHeight; 
        if(i < n) {
            h[i]=li_H;
            li.eq(i).css("top",0);
            li.eq(i).css("left",i * li_W);
            }
        else{
            min_H =Math.min.apply(null,h) ;   
            minKey = getarraykey(h, min_H); 
            h[minKey] += li_H+margin ; 
            li.eq(i).css("top",min_H+margin); 
            li.eq(i).css("left",minKey * li_W);  
        }
        
    }
}

function getheight(){
	 var t=[];
	 var MaxTop;  
	 var gaodu;   
	 var watebox=document.getElementById("wate");
	 var getli=watebox.getElementsByTagName("li");
	for( var i=0; i<getli.length; i++)
	{	
		t[i]=getli[i].offsetTop+getli[i].offsetHeight;//用top值加上li的高度就可以找到最高的那个元素的高度
		MaxTop=Math.max.apply(null,t);
		//alert(getli[i].offsetTop+" "+getli[i].offsetHeight+" "+t[i]);
	}

    // for(var i=0; i<getli.length;i++)
    // {
    //     if(t[i]==MaxTop)
    //     {
    // 	  gaodu=getli[i].offsetHeight;

    // 	}

    // }

    watebox.style.height=MaxTop+"px";
    
    
}
 
function getarraykey(s, v) {for(k in s) {if(s[k] == v) {return k;}}}
 
window.onload = function() {liuxiaofan(),getheight();};
/*浏览器窗口改变时也运行函数*/
window.onresize = function() {liuxiaofan();};
</script>

	
</body>
</html>